<!--  -->
<template>
  <el-container>
    <el-main>
      <div class="same-singer">
        <ul>
          <li v-for="(item, index) in artists" :key="index">
            <div class="img"><img @click="toDeatil(item.id)" :src="item.picUrl" alt="" /></div>
            <div class="title">{{ item.name }}</div>
          </li>
        </ul>
      </div>
    </el-main>
  </el-container>
</template>

<script>
import { getSameSinger } from "util/findMusic.js";

export default {
  name: "",
  data() {
    return {
      currentId: this.$route.params.id,
      artists: [],
    };
  },
  created() {
    this.getSameSinger();
  },
  methods: {
    async getSameSinger() {
      let { data } = await getSameSinger(this.currentId);
      this.artists = data.artists;
    //   console.log(this.artists);
    },
    toDeatil(id){
      this.$router.push('/singerDetail/' + id)
    }
  },
};
</script>

<style scoped>
.same-singer ul {
  display: flex;
  flex-wrap: wrap;
}
.same-singer ul li {
    margin-left: 30px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.same-singer ul li .img{
    width: 220px;
    height: 220px;
    margin-bottom: 10px;
}
.same-singer ul li .img img{
    border-radius: 5px;
    width: 100%;
    height: 100%;
}
.same-singer ul li .title{
    width: 150px;
    font-size: 15px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.same-singer ul li span{
    font-size: 12px;
    color: rgb(141, 135, 135);
}
</style>